import axios from '@/libs/api.request'
import qs from 'qs'

// 根据字典码获取字典表
export const getSelectOption = (params) => {
  return axios.request({
    url: 'admins/dataDict/getDictByCode?t='+new Date().getTime(),
    method: 'get',
    params
  })
}

// 新增机组状态
export const addAircrewStatusRecord = (data) => {
  return axios.request({
    //url: 'admins/aircrewStatusRecord/add',
    url:'admins/equipmentStatus/add',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 搜索机组状态
export const searchAircrewStatusRecord = (params) => {
  return axios.request({
   // url: 'admins/aircrewStatusRecord/page',
   url:'admins/equipmentStatus/page?t='+new Date().getTime(),
    method: 'get',
    params
  })
}

// 删除机组状态
export const removeAircrewStatusRecord = (data) => {
  return axios.request({
    url: 'admins/equipmentStatus/delete',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 修改机组状态
export const updateAircrewStatusRecord = (data) => {
  return axios.request({
    //url: 'admins/aircrewStatusRecord/edit',
    url: 'admins/equipmentStatus/update',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 搜索机组状态
export const getDaiBan = (params) => {
  return axios.request({
   url:'admins/equipmentStatus/getWaitProcessPage?t='+new Date().getTime(),
    method: 'get',
    params
  })
}

// 搜索机组状态
export const getJiLu = (params) => {
  return axios.request({
   url:'admins/equipmentStatus/getHasProcessPage?t='+new Date().getTime(),
    method: 'get',
    params
  })
}

//导出机组当前状态
export const downExcel = (params) => {
  return axios.request({
    url: 'admins/equipmentStatus/download?t='+new Date().getTime(),
    method: 'get',
    responseType: 'blob',
    params
  })
}
